<?php
namespace app\common\enum;

class OrderStatus extends Status
{
	protected static $options = [0 => '待支付', 1 => '待发货', 2 => '待收货', 4=> '已完成', 5 => '待自提', -1 => '关闭订单', -2 => '已删除', -3 => '已分账'];
	protected static $codeOptions = ['daizhifu' => 0, 'daifahuo' => 1, 'daishouhuo' => 2, 'yiwancheng' => 4, 'daiziti' => 5, 'guanbidingdan' => -1, 'yishanchu' => -2, 'yifenzhang' => -3, 'tuikuan' => 'tuikuan'];
	protected static $menu = [0 => '待支付', 1 => '待发货', 'dai' => '待收货/自提', 4=> '已完成'];
	protected static $str2status = ['dai' => [2, 5]];

	public static function isRefund($status) {
		$arr = [0, 1, 2, 4];
		return in_array($status, $arr);
	}

	public static function get_menu() {
		return static::$menu;
	}

	public static function str2status($str) {
		$arr = static::$str2status;
		if(isset($arr[$str])) {
			return $arr[$str];
		} else {
			return false;
		}
	}
}
